<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/resource/common.jsp"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>${title }</title>
   
	<script type="text/javascript" src="<c:url value='/resource/js/view/person.js'/>"></script>
    <script type="text/javascript" >
    $(function(){
		$("#query_form").css({"width":$(window).width()});
			$.get(parent.formateUrl("person/getPerson/0.json"), {}, function(data) {
				$.each(data.list, function(i, s) {
					$("#dbId").append("<option value='" + sysUser.dbId + "'>" + sysUser.name + "</option>");
				});
				$("#dbId").val("${sysUser.dbId}");
			}, "json");
		
		$('#test').datagrid({
			iconCls:'icon-save',
			width:$(window).width(),
			height:$(window).height()-42,
			nowrap: true,
			striped: true,
			fitColumns:true,
			url:'<%=path%>/person/person_mgr/list.json',
			idField:'dbId',
			singleSelect:true,
			onLoadSuccess:function(data){
				$(this).datagrid('doCellTip',{'max-width':'300px','delay':500});
			},
			frozenColumns:[[
			]],
			columns:[
			  [	
				{field:'dbId',title:'dbid',width:200,align:'left'},
			  	{field:'policeNum',title:'警号',width:200,align:'left'},
			  	{field:'name',title:'姓名',width:200,align:'left'},
			  	{field:'dutyName',title:'职务',width:200,align:'left'},
				{field:'opt',title:'操作',width:200,align:'center', fixed:true,
					formatter:function(value,rec){
						return "&nbsp;<a href='javascript:editDictionary("+rec.dbId+")'>修改</a>&nbsp;"+
						"&nbsp;<a href='javascript:deleteDict("+rec.dbId+")'>删除</a>&nbsp;"
						;
					}
				},
			]],
			pagination:true,
			rownumbers:true
			
		});
		var p = $('#test').datagrid('getPager');
		$(p).pagination({
			onBeforeRefresh:function(){
			}
		});				

	});
    </script>
    

	
  </head>
  
  <body>
   
   	<div>
		<div>
	    	<form class="app_form_query" id="query_form" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="4" style="background:#e9f8ff; border:1px solid #cbd9e4; font-size:14px;">
	    			<tr>
	    				
	    				<td class="td_label">请输入dbId</td>
	    				<td class="td_text"><input type="text" id="name" name="name" style="width:180px;" value="${sysUser.dbid}"  onblur="this.value=this.value.replace(/[^\w\b\u4e00-\u9fa5]/g,'');"/></td>
	    				<td class="td_label" style="width:300px;text-align: left">
	    						<a href="javascript:_goto(1);">查询</a>&nbsp;&nbsp;
	    						<a href="javascript:formReset()">重置</a>&nbsp;&nbsp;
	    					<a href="javascript:addDictionary();">新增</a>
	    				</td>
	    				<td>&nbsp;&nbsp;</td>
	    			</tr>
	    		</table>
	    	</form>
	   	</div>
	   	<div id="tbl_container">
	   		<table id="test" data-options="toolbar:'#tb'"></table>
	   		
		</div>
		
	</div>
   
  </body>
</html>
